<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="java.net.*,org.springside.core.Constants,cn.firstsoft.firstframe.admin.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
int error_code = 0;
String id = request.getParameter("id");

if (id != null && !"".equals(id)) {
	
	String jndi_eas_name = "jdbc/" + id;
	if ("TOMCAT".equals(Environment.getWebServerName())) 
		jndi_eas_name = "java:comp/env/" + jndi_eas_name;
		
	if (!PropertyFile.writeProperties("jdbc.properties", "jndi.eas_name", jndi_eas_name)) {
		out.println("写入参数文件出错！");
		error_code = 4;
	}
	
} else {
	out.println("输入的参数不正确！");
	error_code = 1;
}
%>
<html>
<head>
<title>管理控制台 - 数据中心</title>
<%@ include file="/common/meta2.jsp"%>
<link href="../style.css" type="text/css" rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%">
  <tr>
  	<td width="100%">
  		<% if (error_code > 0) { %>
  		数据中心启用错误，错误编号：<%=error_code %>，<a href="index.jsp">点这里返回数据中心列表</a>
  		<% } else { %>
  		新数据中心启用成功！生效必须重新启动服务器！<a href="index.jsp">点这里返回数据中心列表</a>
  		<% } %>
  	</td>
  </tr>
</table>
</body>
</html>
